Skip to content

MkBlockQuote

Show source on GitHub

BlockQuote node.

Example: Regular

Jinja

{{ "Some text" | MkBlockQuote }}

Python

MkBlockQuote('Some text')

Some text

> Some text
<blockquote>
<p>Some text</p>
</blockquote>
    Some text
MkBlockQuote
╰── MkText('Some text')

Example: Nested

Jinja

{{ "Nested!" | MkBlockQuote | MkBlockQuote }}

Python

MkContainer([...])

Nested!

Nested!

> Nested!


> > Nested!
<blockquote>
<p>Nested!</p>
<blockquote>
<p>Nested!</p>
</blockquote>
</blockquote>
MkContainer
├── MkBlockQuote('Nested!')
│   ╰── MkText('Nested!')
╰── MkBlockQuote([list([...])])
├── MkBlockQuote('Nested!')
│   ╰── MkText('Nested!')

Bases: MkContainer

Name Children Inherits
MkContainer
mknodes.basenodes.mkcontainer
A node containing other MkNodes.
graph TD
  94854582723216["mkblockquote.MkBlockQuote"]
  94854582919984["mkcontainer.MkContainer"]
  94854582916880["mknode.MkNode"]
  94854582838576["node.Node"]
  140544995341632["builtins.object"]
  94854582919984 --> 94854582723216
  94854582916880 --> 94854582919984
  94854582838576 --> 94854582916880
  140544995341632 --> 94854582838576
/home/runner/work/mknodes/mknodes/mknodes/basenodes/mkblockquote/metadata.toml
[metadata]
icon = "mdi:format-quote-open"
name = "MkBlockQuote"

[examples.regular]
title = "Regular"
jinja = """
{{ "Some text" | MkBlockQuote }}
"""

[examples.nested]
title = "Nested"
description = "We can also nest blocks, they will adjust their delimiters automatically."
jinja = """
{{ "Nested!" | MkBlockQuote | MkBlockQuote }}
"""

[output.markdown]
template = """
{{ node.items | join(node.block_separator) | indent(width="> ", first=True) | rstrip("\n") }}

"""

# [output.html]
# template = """
# <blockquote>
# {{ node.items | join(node.block_separator)  }}
# </blockquote>
# """

[output.rst]
template = """
{{ node.items | join(node.block_separator) | indent(width="    ", first=True) | rstrip("\n") }}

"""
mknodes.basenodes.mkblockquote.MkBlockQuote
class MkBlockQuote(mkcontainer.MkContainer):
    """BlockQuote node."""

    ICON = "material/format-quote-open"
    STATUS = "new"

    def _to_markdown(self) -> str:
        text = super()._to_markdown()
        return textwrap.indent(text, "> ").rstrip("\n") + "\n"